//package com.bytecub.simulate.device.instance;
//
//import com.bytecub.common.domain.dto.response.prop.TemplateResDto;
//import com.bytecub.utils.DateUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.scheduling.annotation.Async;
//import org.springframework.scheduling.annotation.EnableAsync;
//import org.springframework.stereotype.Service;
//
//import java.util.Date;
//
///**
//  * ByteCub.cn.
//  * Copyright (c) 2020-2021 All Rights Reserved.
//  * 废弃
//  * @author bytecub@163.com  songbin
//  * @version Id: ReporterService.java, v 0.1 2021-02-20  Exp $$
//  */
//@EnableAsync
//@Service
//@Slf4j
//public class ReporterService {
//   static long count = 0;
//    @Async("device-report-data")
//    public void execute(DeviceInstance deviceInstance, int index){
//        while(true){
//            Date todayDate = DateUtil.getDayBegin(new Date());
//            if(System.currentTimeMillis() - todayDate.getTime() < 1000*60*10){
//                ReporterService.count = 0;
//            }else{
//                ReporterService.count++;
//                log.info("今日发送消息数量:{} 当前设备:[{}]{}", ReporterService.count, index, deviceInstance.deviceCode);
//            }
//            this.report(deviceInstance);
//        }
//    }
//
//    private void report(DeviceInstance deviceInstance){
//        try{
//            deviceInstance.reportData();
//            Thread.sleep(1000);
//        }catch (Exception e){
//            log.warn("异常", e);
//        }
//    }
//}
